<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise</title>
</head>
<body>
    
</body>
</html>

<script>
    const obj = {
        a:1
    };

    new Promise((resolve , reject )=>{
        setTimeout(( )=>{
            obj.a++
            console.log("1层打印a：",obj.a)
            resolve()
        },2*1000 )
    }).then(()=>{

return new Promise((resolve , reject)=>{

    setTimeout(()=>{
        
        obj.a++ 
        console.log("2层打印a：",obj.a)
        resolve()
    },1*1000 )

})
}).then(()=>{

return new Promise((resolve , reject)=>{

    setTimeout(()=>{
        
        obj.a++
        console.log("3层打印a：",obj.a)
        resolve()
    },3*1000 )

})
})
</script>